package day13;

import java.util.HashSet;
import java.util.Iterator;
import java.util.TreeSet;

public class TestTreeSet {
	public static void main(String[] args) {
		TreeSet ts = new TreeSet();
		ts.add("ddd");
		ts.add("aaa");
		ts.add("ccc");
		ts.add("bbb");
		Iterator it = ts.iterator();
		while(it.hasNext()){
			System.out.println(it.next());
		}
		HashSet set = new HashSet();
		long start = System.nanoTime();
		for(int i=0; i<3000; i++){
			set.add(i);
		}
		long end = System.nanoTime();
		System.out.println(end-start);
		TreeSet ts1 = new TreeSet();
		start = System.nanoTime();
		for(int i=0; i<3000; i++){
			ts1.add(i);
		}
		end = System.nanoTime();
		System.out.println(end-start);

	}
}
